package com.zh.kotlin_mvvm.pinyin;

import java.util.Comparator;

public class PinyinComparator implements Comparator<CommEx> {

    public int compare(CommEx o1, CommEx o2) {
        //根据ABCDEFG...来排序
        if (o1.sortLetter.equals("#")) {
            return 1;
        } else if (o2.sortLetter.equals("#")) {
            return -1;
        } else {
            return o1.sortLetter.compareTo(o2.sortLetter);
        }
    }
}